#include "lines.h"

lineReader::lineReader()
{
    s=new char[100];
}

lineReader::~lineReader() {}

ifstream& operator>>(ifstream& in, lineReader l)
{
    char c,prev;
    in.get(c);
    l.s[0]=c;
    prev=c;
    int i=0;
    while (!in.eof())
    {
        in.get(c);
        if (prev=='\n')
        {
            i++;
            l.s[i]=c;
            prev=c;
        }
        else prev=c;
    }
    return in;
}

ofstream& operator<<(ofstream& out, lineReader l)
{
    int i = 0;
    while (l.s[i]!='\0')
    {
        out<<l.s[i];
        i++;
    }
    return out;
}